<% content_for :title do %>Display all Users<% end %>

<h1>Users:</h1>
<table>
	<thead>
		<tr>
			<th>Id:</th>
			<th>First Name:</th>
			<th>Last Name:</th>
			<th>Email:</th>
			<th>Action:</th>
		</tr>
	</thead>
	<tbody>
		<% @user.each do |user_data| %>
			<tr>
				<td><%= user_data.id %></td>
				<td><%= user_data.first_name %></td>
				<td><%= user_data.last_name %></td>
				<td><%= user_data.email %></td>
				<td>
					<%= link_to 'View', user_data, :class => "button tiny" %>
				    <%= link_to 'Edit', edit_user_path(user_data), :class => "button success tiny" %>
				    <%= link_to 'Delete', user_data, method: :delete, data: { confirm: 'Are you sure?' }, :class => "button alert tiny"%>
				</td>
			</tr>
		<% end %>
	</tbody>
</table>
